package tabbedPane;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

public class TabbedPane extends JFrame {
    
    public TabbedPane() {
        
        setTitle("Tabbed Pane");
        JTabbedPane jtp = new JTabbedPane();
        Dimension d = new Dimension(500, 300);
        jtp.setPreferredSize(d);
        getContentPane().add(jtp);
        JPanel jp1 = new JPanel();
        JPanel jp2 = new JPanel();
        JLabel label1 = new JLabel();
        label1.setText("You are in area of Tab1");
        JLabel label2 = new JLabel();
        label2.setText("You are in area of Tab2");
        jp1.add(label1);
        jp2.add(label2);
        jp1.setBackground(Color.ORANGE);
        jtp.addTab("Users", jp1);
        jtp.addTab("Groups", jp2);
        
    }
    public static void main(String[] args) {
        
        TabbedPane tp = new TabbedPane();
        Dimension d = new Dimension(500, 300);
        tp.setPreferredSize(d);
        tp.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        tp.setVisible(true);
        
    }
}
